<template>
    <div class="modhospital">
        <el-card class="box-card" shadow="hover" @click="goDetail">
            <div class="content">
                <div class="left">
                    <div class="hospatil_name">
                        {{ hospitalInfo.hosname }}
                    </div>
                    <div class="tips">
                        <div class="level"><i class="ri-thumb-up-line"></i><span>{{ hospitalInfo.param.hostypeString
                        }}</span>
                        </div>
                        <div class="time"><i class="ri-time-line"></i><span>每天{{ hospitalInfo.bookingRule.quitTime
                        }}放号</span>
                        </div>
                    </div>
                </div>

                <div class="right">
                    <img :src="`data:image/jpeg;base64,${hospitalInfo.logoData}`" alt="">
                </div>
            </div>

        </el-card>
    </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';
const props =defineProps(['hospitalInfo'])
let $router = useRouter()
const goDetail = () =>{
    // 接受父组件传过来的props->即为已有医院的数据
    $router.push({path:'/hospital/register',query:{hoscode:props.hospitalInfo.hoscode}})
    
}
</script>

<style scoped lang="scss">
.modhospital {
    width: 48%;
    margin: 5px 0;
    .content {
        display: flex;
        justify-content: space-between;

        .left {
            width: 60%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;

            .tips {
                display: flex;
                justify-content: space-between;
                margin-bottom: 10px;
                font-size: 10px;
                color: rgb(87, 87, 87);

                span {
                    margin-left: 5px;
                }

            }
        }

        .right {
            img {
                height: 50px;
                width: 50px;
            }
        }
    }
    .box-card {
        height: 100px;
    }

    .box-card:hover {
        cursor: pointer;

        .hospatil_name {
            font-weight: bold;
        }
    }
}
</style>